package com.lly.songhigh.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class LocalMusicInfo implements Parcelable {
    private long id;
    private long album_id;
    private String title;
    private String artist;
    private long duration;
    private long size;
    private String url;
    private String album;
    private int isMusic;
    private boolean isFavorite = false;
    private String resouce;

    public String getResouce() {
        return resouce;
    }

    public void setResouce(String resouce) {
        this.resouce = resouce;
    }

    public void setId(long id){
        this.id = id;
    }

    public long getId(){return this.id;}

    public void setTitle(String title){
        this.title = title;
    }

    public String getTitle(){return this.title;}

    public void setArtist(String artist){
        this.artist = artist;
    }

    public String getArtist(){return this.artist;}

    public void setDuration(long duration){this.duration = duration;}

    public long getDuration(){return this.duration;}

    public void setSize(long size){this.size = size;}

    public long getSize(){return this.size;}

    public void setUrl(String url){this.url = url;}

    public String getUrl(){return this.url;}

    public void setAlbum(String album){this.album = album;}

    public String getAlbum(){return this.album;}

    public void setAlbum_id(long album_id){this.album_id = album_id;}

    public long getAlbum_id(){return this.album_id;}

    public void setFavorite(boolean favorite){this.isFavorite =favorite;}

    public boolean getFavorite(){return isFavorite;}

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.id);
        dest.writeLong(this.album_id);
        dest.writeString(this.title);
        dest.writeString(this.artist);
        dest.writeLong(this.duration);
        dest.writeLong(this.size);
        dest.writeString(this.url);
        dest.writeString(this.album);
        dest.writeInt(this.isMusic);
        dest.writeByte(isFavorite ? (byte) 1 : (byte) 0);
    }

    public LocalMusicInfo() {
    }

    protected LocalMusicInfo(Parcel in) {
        this.id = in.readLong();
        this.album_id = in.readLong();
        this.title = in.readString();
        this.artist = in.readString();
        this.duration = in.readLong();
        this.size = in.readLong();
        this.url = in.readString();
        this.album = in.readString();
        this.isMusic = in.readInt();
        this.isFavorite = in.readByte() != 0;
    }

    public static final Parcelable.Creator<LocalMusicInfo> CREATOR = new Parcelable.Creator<LocalMusicInfo>() {
        public LocalMusicInfo createFromParcel(Parcel source) {
            return new LocalMusicInfo(source);
        }

        public LocalMusicInfo[] newArray(int size) {
            return new LocalMusicInfo[size];
        }
    };
}

